package com.java.test.system.gametfeemanage.entity;

import lombok.Data;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;

/**
 * 游戏抽水实体
 */
@Data
public class GameFeeEntity implements RowMapper<GameFeeEntity> {
    private Long id;//id
    private String name;//名称
    private int gameType;//游戏类型
    private Double feeScale;//抽水比例
    private String remarks;//备注
    private String operation;//操作人
    private Date modifyTime;//操作时间
    private Date createTime;//创建时间
    private int status;//状态
    private String gameTypeStr;//游戏类型
    private String feeScaleStr;//抽水比例


    @Override
    public GameFeeEntity mapRow(ResultSet resultSet, int i) throws SQLException {
        GameFeeEntity info = new GameFeeEntity();

        info.setId(resultSet.getLong("id"));
        info.setName(resultSet.getString("name"));
        info.setGameType(resultSet.getInt("game_type"));
        info.setFeeScale(resultSet.getDouble("fee_scale"));
        info.setRemarks(resultSet.getString("remarks"));
        info.setOperation(resultSet.getString("operation"));
        info.setCreateTime(resultSet.getDate("createTime") == null ? null : resultSet.getDate("createTime"));
        info.setModifyTime(resultSet.getDate("modifyTime") == null ? null : resultSet.getDate("modifyTime"));
        info.setStatus(resultSet.getInt("status"));
        info.setGameTypeStr(resultSet.getString("gameTypeStr")==null?null : resultSet.getString("gameTypeStr"));
        info.setFeeScaleStr(resultSet.getString("feeScaleStr")==null?null : resultSet.getString("feeScaleStr"));
        return info;
    }
}
